package com.ctim.model.user;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    private int userId;

    /**
     * 账号
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 手机号码
     */
    private String phone;

    /**
     * 描述
     */
    private String description;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 用户状态,0:创建未认证（比如没有激活，没有输入验证码等等）--等待验证的用户 , 1:正常状态,2：用户被锁定
     */
    private Integer status;

    /**
     * 加密密码的盐
     */
    private String salt;

    private Integer updateUid;


    /**************   前端显示     *******************/
    private String createUserName;
    /**
     * 菜单树
     */
    private List<Resource> menuTree;
    /**
     * 权限
     */
    private List<Resource> permissions;

    /**
     * 用户角色
     */
    private List<Role> roles;

    /**
     * 所有角色名称     逗号分割
     */
    private String roleNames;
    /**
     * 所有角色 id      逗号分割
     */
    private String roleIds;

    /**
     * 默认首页 url 地址  如果有客户查询的菜单权限则显示客户列表，否则选择该用户所拥有的其中一个菜单
     */
    private String defaultIndexUrl;

    public User() {
    }

    public User(int addUser, String addUserName) {
        this.userId = addUser;
        this.username = addUserName;
    }


    public String getRoleNames() {
        return roleNames;
    }

    public void setRoleNames(String roleNames) {
        this.roleNames = roleNames;
    }


    public List<Resource> getMenuTree() {
        return menuTree;
    }

    public void setMenuTree(List<Resource> menuTree) {
        this.menuTree = menuTree;
    }

    public List<Resource> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Resource> permissions) {
        this.permissions = permissions;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 密码盐.
     * @return
     */
    public String getCredentialsSalt(){
        return this.salt;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public String getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(String roleIds) {
        this.roleIds = roleIds;
    }

    public String getDefaultIndexUrl() {
        return defaultIndexUrl;
    }

    public void setDefaultIndexUrl(String defaultIndexUrl) {
        this.defaultIndexUrl = defaultIndexUrl;
    }

    public Integer getUpdateUid() {
        return updateUid;
    }

    public void setUpdateUid(Integer updateUid) {
        this.updateUid = updateUid;
    }
}